package a.student.library;

import a.student.library.BaseDto;
import android.database.Cursor;

	/*
	
		Class name: Assignment.java
		Function: Day la lop chua thong tin chi tiet cua mot Assignment. 
			Lop nay don gian chi chua cac Constructor de khoi tao doi tuong dung luu tru du lieu.
		
	*/
public class Assignment extends BaseDto{
	public int id;
	public String name;
	public int priority;
	public String dueDate;
	public boolean done;
	public String des;
	public String alertTime;
	public String classID;
	public String className;
	
//	Name,Priority,Due_Date,Description,Alert_Time,Done,CL_ID
	
	public static final String ASSIGNMENT_ID = "Assignment_ID";
	public static final String ASSIGNMENT_NAME = "Name";
	public static final String ASSIGNMENT_PRIORITY = "Priority";
	public static final String ASSIGNMENT_DUEDATE = "Due_Date";
	public static final String ASSIGNMENT_DESC = "Description";
	public static final String ASSIGNMENT_ALERTTIME = "Alert_Time";
	public static final String ASSIGNMENT_DONE = "Done";
	public static final String ASSIGNMENT_CLID = "CL_ID";
	
	public static final String ASSIGNMENT_TBL_NAME = "Assignment";
	public static final String ASSIGNMENT_DEFAULT_SORT_ORDER = ASSIGNMENT_ID + " ASC";

	public Assignment(Cursor c){
		super();
		this.id = c.getInt(c.getColumnIndex(ASSIGNMENT_ID));
		this.name = c.getString(c.getColumnIndex(ASSIGNMENT_NAME));
		this.priority = c.getInt(c.getColumnIndex(ASSIGNMENT_PRIORITY));
		this.des = c.getString(c.getColumnIndex(ASSIGNMENT_DESC));
		this.dueDate = c.getString(c.getColumnIndex(ASSIGNMENT_DUEDATE));
		this.alertTime = c.getString(c.getColumnIndex(ASSIGNMENT_ALERTTIME));
		this.done = c.getString(c.getColumnIndex(ASSIGNMENT_DONE)).equals("1")?true:false;
		this.classID = c.getString(c.getColumnIndex(ASSIGNMENT_CLID));
	}
	
	public Assignment(int id,String name, int priority,String des,String dueDate,String alertTime,boolean done,String classID){
		this.id = id;
		this.name = name;
		this.priority = priority;
		this.des = des;
		this.dueDate = dueDate;
		this.alertTime = alertTime;
		this.done = done;
		this.classID = classID;
	}
	public Assignment(int id,String name, int priority,String des,String dueDate,String alertTime,boolean done,String classID,String className){
		this.id = id;
		this.name = name;
		this.priority = priority;
		this.des = des;
		this.dueDate = dueDate;
		this.alertTime = alertTime;
		this.done = done;
		this.classID = classID;
		this.className = className;
	}
	public Assignment(String dueDate) {
		this.dueDate = dueDate;
	}
	public int getAssignmentId() {
		return id;
	}
	public void setAssignmentId(int id) {
		this.id = id;
	}
	
	
}
